<?php
/**
 * Description of validateclass
 *
 * @author Arco
 */
class Validate {

    public static function equals($i, $h){
        if($i==$h) {
            return true;
        }else{
            return false;
        }
    }

    public static function checkLength($i, $minLenght, $maxLenght){
        if(strlen($i)<$minLenght || strlen($i)>$maxLenght) {
            return false;
        }else {
            return true;
        }
    }

    public static function checkEmail($email) {
        global $qm;
        return $qm->checkExistence("user", "email", $email);
    }

    public static function checkUser($user) {
        global $qm;
        return $qm->checkExistence("user", "email", $user);
    }
}
?>
